<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<!-- <script src='/Public/jquery.min.js'></script> -->
  <script src="https://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
  
	<script src='/Public/foundation/js/foundation.min.js'></script>
	<link rel="stylesheet" href="/Public/foundation/css/foundation.min.css">
  <script src='/Public/jquery.cityselect.js'></script>
  <script src='/Public/jquery.datetimepicker.full.js'></script>
  <link rel="stylesheet" href="/Public/jquery.datetimepicker.css">
   <script src="http://cdn.static.runoob.com/libs/foundation/5.5.3/js/vendor/modernizr.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<nav class="top-bar" data-topbar>
  <ul class="title-area">
    <li class="name">
      <h1><a href="#">后台管理</a></h1>
    </li>
  </ul>

  <section class="top-bar-section">
    <ul class="right">
      <li><a href=""><?php echo (session('name')); ?></a></li>
      <li><a href="<?php echo U('Login/doLogout');?>">退出</a></li>
    </ul>
  </section>
</nav>

<div class="small-2 columns">
<ul class="side-nav">
 <?php if(is_array($nav)): $i = 0; $__LIST__ = $nav;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li><a href="<?php echo U($vo['url']);?>" target='<?php echo ($vo["target"]?"_blank":null); ?>'><?php echo ($vo["mname"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
    </ul>
</div>
<div class="small-10 columns">

   <center>
       <select  id="stuName" style="margin-top: 5%;width: 20%;height: 33px">
           <option value="0" selected>请选择</option>
           <?php if(is_array($sn)): $i = 0; $__LIST__ = $sn;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sn): $mod = ($i % 2 );++$i;?><option value="<?php echo ($sn["student_id"]); ?>"><?php echo ($sn["sname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
       </select>
       <div class="row" style="margin-top: 5%" id="row"></div>
   </center>
    <script>
        $('#stuName').change(function () {
            if($('#stuName option:selected').val()=='0'){
                $('#row').html('');
            }else {
                $.post("<?php echo U('Director/getScore');?>",{id:$('#stuName option:selected').val()},function (data) {
                    var html='<table>';
                    var scoreEnd=parseFloat(data['num']['exaNum'])-parseFloat(data['num']['poiNum']);
                    if(data['exa']=='暂无考试成绩记录'){
                        html+='<tr><td colspan="3" style="text-align: center">'+data['exa']+'</td></tr>';
                    }else{
                        for(i in data['exa']){
                            html+='<tr><td>'+data['exa'][i]['examtime']+'</td><td style="text-align: center">'+data['exa'][i]['exam_name']+'</td><td>'+data['exa'][i]['score']+'</td></tr>'
                        }
                    }
                    if(data['poi']=='暂无扣分记录'){
                        html+='<tr><td colspan="3" style="text-align: center">'+data['poi']+'</td></tr>';
                    }else{
                        for(i in data['poi']){
                            html+='<tr><td>'+data['poi'][i]['points_time']+'</td><td>'+data['poi'][i]['rule_name']+'</td><td>'+data['poi'][i]['score']+'</td></tr>'
                        }
                    }
                    html+='<tr><td>总分:</td><td colspan="2" style="text-align: center">'
                            +data['num']['exaNum']+'-'+data['num']['poiNum']+'='+scoreEnd
                            +'</td></tr></table>'
                    html+='<buttom class="button tiny  radius danger" onclick="gd()">归档</buttom>'
                    $('#row').html(html);
                })
            }
        })
        function gd() {
            $.post("<?php echo U('Director/filed');?>",{id:$('#stuName option:selected').val()},function (data) {
                alert(data);
            })
        }
    </script>

</div>

</body>
</html>